0 GOSUB8:CLEAR100:DIMLU(1,2),X(1),Y(1),X1(63),Y1(47),X2(63),Y2(47):FORX=0TO1:FORY=0TO2:READLU(X,Y):NEXTY,X:DATA32,8,2,16,4,1
1 DIMH(140),TW,F4,DV,BE,F7,F(2,2),B(2,4),SC(2),P$(2),L(12),V(12),A(13),VI,VND,D,X1,Y1,TT,PST,BY,VI,VL,MA,ZE,T3:GOTO20
2 POKEBY,MA:IFMA<192THENPOKEBY,MA+64
3 POKEVC,68:RETURN
4 POKEVC,ZE:RETURN
5 BY=X1(C)+Y1(D):VL=LU(X2(C),Y2(D))
6 MA=VLORPEEK(BY):ONPSTGOTO7,2:POKEBY,NOT(NOTMAORVL):RETURN
7 POKEBY,MA:RETURN
8 CLS:PRINT"PLEASE WAIT...":C=RND(-(PEEK(9)*256+PEEK(10))):RETURN
10 FORZ=1TO800:NEXT:RETURN
15 FORC=ZETOT3:BE=INT(H(C*TW)/F4):DV=USR((C*256+BE)*65536+C*256+F7):NEXT
16 FORT=1TO2:POKEF(T,1),B(T,1):POKEF(T,1)+32,B(T,2):POKEF(T,2),B(T,3):POKEF(T,2)+32,B(T,4):NEXT:RETURN
20 VI=16384:VND=16895:VC=49151:CH=16:TT=32:ZE=0:TW=2:T3=63:F4=4:F7=47:GOSUB3000
21 FORX=0TO63:X1(X)=INT(X/2):X2(X)=INT(X-X1(X)*2):X1(X)=X1(X)+VI:NEXT
22 FORY=0TO47:Y1(Y)=INT(Y/3):Y2(Y)=INT(Y-Y1(Y)*3):Y1(Y)=Y1(Y)*TT:NEXT
25 NM$="":PST=1:GOTO80
30 XC=0:YC=R:PC=3-2*R 
35 GOSUB72
40 IFPC<0THENPC=PC+F4*XC+6:GOTO50
45 PC=PC+F4*(XC-YC)+10:YC=YC-1
50 XC=XC+1 
55 IFXC<YCTHEN35
60 IFXC=YCTHENGOSUB72 
65 RETURN
72 C=CX+XC:D=CY-YC:GOSUB5:C=CX-XC:D=CY-YC:GOSUB5:C=CX+YC:D=CY-XC:GOSUB5:C=CX-YC:D=CY-XC:GOSUB5:RETURN
80 FORI=0TO139:H(I)=0:NEXT
85 FORI=0TOTW:SC(I)=0:P$(I)="":NEXT
90 FORI=0TO11:V(I)=0:A(I)=0:NEXT
95 GOTO1320
100 C=INT(C/F4)
105 D=INT(D/F4):GOSUB5:RETURN
155 FORT=1TO2:B(T,2)=PEEK(F(T,1)+32):B(T,4)=PEEK(F(T,2)+32):NEXT:RETURN
160 N=158-RND(58)
170 IFN/F4-INT(N/F4)<>0THENN=N+1:GOTO170
180 RETURN
240 N1=RND(2)
250 CLS0:GOSUB3
260 XC=20+RND(30):HC=80+RND(40):L(1)=10+RND(XC-10):L(2)=HC+RND(120-HC):W=RND(100)-50
270 GOSUB160:FORI=0TOXC:H(I)=N:NEXT:N=1:T=1:GOSUB1190
280 GOSUB160:FORI=HCTO139:H(I)=N:NEXT:N=2:T=2:GOSUB1190
300 HZ=XC+RND(HC-XC-20)+10:H(HZ)=50+RND(100):N=H(HZ)/TW
330 D1=N-H(1)/TW:D2=N-H(139)/TW:A=180:R=180/(HZ-XC+1):N=H(1)+D1
400 FORI=INT(XC+1)TOINT(HZ-1):A=A-R:H(I)=COS(A*.0174533)*D1+N:NEXT
410 A=0:R=180/(HC-HZ+1):N=H(139)+D2
420 FORI=INT(HZ+1)TOINT(HC-1):A=A+R:H(I)=COS(A*.0174533)*D2+N:NEXT
430 FORC=ZETOT3:BE=INT(H(C*TW)/F4):DV=USR((C*256+BE)*65536+C*256+F7):NEXT:GOSUB155:N=N1
490 N=3-N:S=5*N-4
530 GOSUB4:CLS:PRINT"LAST SHOTS:":FORI=0TO3:PRINTTAB(I*8);A(S+4-I);:NEXT
540 PRINT:FORI=0TO3:PRINTTAB(I*8);V(S+4-I);:NEXT:PRINT
550 PRINT "SIDE FIRING: "; 
560 IF N=1 THEN PRINT "LEFT TO RIGHT":GOTO570
565 PRINT "RIGHT TO LEFT"
570 PRINT "WIND FACTOR"; 
580 IF W<=0 THEN PRINT INT(W+W*-2); "TO THE WEST.":GOTO590
585 PRINTINT(W); "TO THE EAST."
590 PRINT P$(N); 
600 INPUT " CALL YOUR SHOT ";ANG,V
650 GOTO790
740 X=L(N)*TW:GOSUB1720
745 GOSUB10:GOSUB4:CLS:PRINT "YOUR BASE BLEW APART FROM THE"
750 PRINT "FORCE OF THE RECOIL "; P$(N); "."
780 GOTO1120
790 N1=N:GOSUB1220
800 CLS0:GOSUB3
810 GOSUB15
830 IFN=2THENANG=180-ANG
840 V1=COS(ANG*.0174533)*V
845 V2=-(SIN(ANG*.0174533))*V
850 MN=L(N):X=L(N)*2:Y=H(MN)
860 IFN=1THENX=X+1:GOTO870
865 X=X-6
870 IFN=TWTHENX=X-7*-1:GOTO880
875 X=X-7*0
880 IFV>350THEN740
887 OX=0
890 XO=X:YO=Y
900 X=X+V1/10
905 V1=V1+(W-V1)/30:IFX<0ORX>254THEN490
910 Y=Y+V2/10:V2=V2+6
920 IFY<0THEN960
930 IFOX=0THEN950
935 C=OX:D=0:GOSUB100
940 YO=1:XO=OX:OX=0
950 C=X:D=Y:GOSUB100
955 XO=X:YO=Y:GOTO970
960 OX=X
970 IFH(X/TW)-Y>TWTHEN900
980 Y=H(X/TW)+TW
990 C=X:D=Y:GOSUB100
1000 IFABS(X/TW-L(3-N))<3THEN1080
1010 IFABS(X/TW-L(N))>3THENGOSUB10:GOTO490
1020 GOSUB1720
1030 GOSUB10:GOSUB4:CLS:PRINT"YOU DESTROYED YOURSELF ";P$(N);"."
1040 N1=N:GOTO1120
1080 GOSUB1720
1085 GOSUB10:GOSUB4:CLS
1090 WIN=N
1110 N=3-N:N1=3-N
1120 SC(3-N)=SC(3-N)+1:IF SC(3-N)+SC(N)=GN THEN 1580
1125 PRINT:PRINT"PRESS enter FOR NEXT BATTLE"
1126 IFINKEY$<>CHR$(13)THEN1126
1130 FORI=1TO10:A(I)=0:V(I)=0:NEXT:GOTO250
1190 PA=(L(N)*2):PY=(H(L(N))-1)
1200 C=PA:D=PY:GOSUB100:C=PA:D=PY-4:GOSUB100:C=PA:D=PY-8:GOSUB100:F(T,1)=BY:B(T,1)=MA
1210 C=PA+SGN(W)*4:D=PY-8:GOSUB100:F(T,2)=BY:B(T,3)=MA:RETURN
1220 NN=5*N:FORJ=1TO4:K=NN-5+J:A(K)=A(K+1):V(K)=V(K+1):NEXT
1225 V(NN)=V:A(NN)=ANG:RETURN 
1320 GOSUB4
1330 CLS
1370 PRINTTAB(5)"** DUELLING CANNONS **"
1372 PRINT 
1374 PRINT "GAME RULES ARE SIMPLE:":PRINT
1390 PRINT "BLOW UP YOUR OPPONENT BY FIRING"
1400 PRINT "AT THE RIGHT ANGLE AND VELOCITY"
1410 PRINT "WHILE COMPENSATING FOR WIND AND"
1415 PRINT "TERRAIN.  EACH GUNNER MUST"
1420 PRINT "ENTER THE ANGLE (0-90) AND THE"
1440 PRINT "VELOCITY (MAX. 350) SEPARATED"
1445 PRINT "BY A COMMA."
1450 PRINT 
1460 PRINT "PLAYERS' NAMES:"
1470 FORI=1TO2
1480 PRINT"PLAYER";I;:INPUT P$(I)
1490 NEXT
1510 INPUT "HOW MANY BATTLES TO PLAY ";GN
1520 IFGN<1ORGN>100THEN PRINT "PLEASE, DON'T JOKE AROUND!":GOTO1510
1530 GOTO240
1580 CLS:SOUND130,3
1620 PRINT "THE SCORE:  ":PRINT P$(1);
1625 PRINT "="; SC(1):PRINT P$(2);:PRINT "="; SC(2)
1630 IFSC(1)>SC(2)THEN WI=1
1640 IFSC(1)<SC(2)THEN WI=2
1650 IFSC(1)=SC(2)THEN 1680
1660 PRINT P$(WI); " IS THE WINNER!"
1670 GOTO1700
1680 PRINT "A TIE!"
1700 INPUT "PLAY AGAIN (Y/N)";NM$:IF NM$="" THEN 1700
1705 NM$=LEFT$(NM$,1):IF NM$="Y" OR NM$="y" THEN 80
1710 END 
1720 IFX>128THENX=L(2)*2:Y=H(L(2)):GOTO1730
1725 X=L(1)*2:Y=H(L(1))
1730 CX=INT(X/F4):CY=INT(Y/F4):R=1:PST=2:GOSUB30
1740 R=2:GOSUB30:R=3:GOSUB30
1760 PST=1:RETURN
2000 REM GRAPHICS M.L. ROUTINE BY GREG DIONNE
2010 REM <dummyvar>=USR( (X0*256+Y0)*65536 + X1*256+Y1) DRAW LINE
2020 REM <dummyvar>=USR( (X0*256+Y0)*65537) SINGLE POINT
3000 DATALNPDALMMABABNNLLNMMMJAMKCCAJCFADHPAALLHAAALLEANAMLCCAJCFADHPAALMHAAALMFANNNGBBCDHCEPJHMOJHNLJGNGJHNMINDCJG
3001 DATAMKJBMMCHCIJLLLJHMKJGMOJLNHJHMOBGJANLCKABEANANMCKABFABBCFOANGNMNHNLNLNGNHNMNGMLNLLMNHMLCANAFPHOOMOCNMMKNNNI
3002 DATAJGNJMGKLDNIGIAMAFFEEEEMLFFMBFFCEPIHEAANICEABEEIKIAJHNKIGCADNNLNIIJAAIKEAIEEBNNNINONINGNKOKAAOHAADJEPJHMOJH
3003 DATANLJGNHJHNMINMAJGMLJBMNCHLGJLLMJHMLJGMOJLNGJHMOBGJANLCKABEANANMCKABFABBCFOANGNMNHNLNLNHNHNMNGMKNLLLNHMKCANA
3004 Z=32768:FORX=0TO3:READA$:GOSUB3005:NEXT:Z=277:A$="HOIAAA"
3005 FORY=1TOLEN(A$)/2:POKEZ,(ASC(MID$(A$,2*Y-1,1))-65)*16+ASC(MID$(A$,2*Y,1))-65:Z=Z+1:NEXT:RETURN
